package com.douqu.game.main.server.entity;

import java.util.List;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-01-20 11:55
 */
public class MailGroup {

    /**
     * 1.选择范围
     * 2.指定玩家
     */
    private boolean fixedPlayer;
    /**
     * 如果这个有值，表示给指定玩家发
     */
    private List<String> playerNameList;

    private int camp;

    private int minLevel;

    private int maxLevel;

    /**
     * 上次登录到现在的天数
     * 玩家多少天内登陆过游戏
     * 0 表示不限
     */
    private int lastLoginDays;

    private MailSingle mail;

    public boolean check()
    {
        if(camp < 0)
            return false;

        if(maxLevel > 0 && minLevel > maxLevel)
            return false;

        if(mail == null)
            return false;

        if(lastLoginDays < 0)
            return false;

        if(!mail.check())
            return false;

        return true;
    }

    public int getCamp() {
        return camp;
    }

    public void setCamp(int camp) {
        this.camp = camp;
    }

    public int getMinLevel() {
        return minLevel;
    }

    public void setMinLevel(int minLevel) {
        this.minLevel = minLevel;
    }

    public int getMaxLevel() {
        return maxLevel;
    }

    public void setMaxLevel(int maxLevel) {
        this.maxLevel = maxLevel;
    }

    public MailSingle getMail() {
        return mail;
    }

    public void setMail(MailSingle mail) {
        this.mail = mail;
    }

    public int getLastLoginDays() {
        return lastLoginDays;
    }

    public void setLastLoginDays(int lastLoginDays) {
        this.lastLoginDays = lastLoginDays;
    }

    public List<String> getPlayerNameList() {
        return playerNameList;
    }

    public void setPlayerNameList(List<String> playerNameList) {
        this.playerNameList = playerNameList;
    }

    public boolean isFixedPlayer() {
        return fixedPlayer;
    }

    public void setFixedPlayer(boolean fixedPlayer) {
        this.fixedPlayer = fixedPlayer;
    }

    @Override
    public String toString() {
        return "{" +
                "fixedPlayer=" + fixedPlayer +
                ", playerNameList=" + playerNameList +
                ", camp=" + camp +
                ", minLevel=" + minLevel +
                ", maxLevel=" + maxLevel +
                ", lastLoginDays=" + lastLoginDays +
                ", mail=" + mail +
                '}';
    }
}
